/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package azhar.persistance;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Al-Insan
 */
@Entity
@Table(name = "guru")
@NamedQueries({
    @NamedQuery(name = "Guru.findAll", query = "SELECT g FROM Guru g"),
    @NamedQuery(name = "Guru.findByIdGuru", query = "SELECT g FROM Guru g WHERE g.idGuru = :idGuru"),
    @NamedQuery(name = "Guru.findByNip", query = "SELECT g FROM Guru g WHERE g.nip = :nip"),
    @NamedQuery(name = "Guru.findByNamaGuru", query = "SELECT g FROM Guru g WHERE g.namaGuru = :namaGuru"),
    @NamedQuery(name = "Guru.findByAlamat", query = "SELECT g FROM Guru g WHERE g.alamat = :alamat"),
    @NamedQuery(name = "Guru.findByNoHp", query = "SELECT g FROM Guru g WHERE g.noHp = :noHp"),
    @NamedQuery(name = "Guru.findByIdJenjang", query = "SELECT g FROM Guru g WHERE g.idJenjang = :idJenjang")})
public class Guru implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_guru")
    private Integer idGuru;
    @Basic(optional = false)
    @Column(name = "nip")
    private String nip;
    @Basic(optional = false)
    @Column(name = "nama_guru")
    private String namaGuru;
    @Basic(optional = false)
    @Column(name = "alamat")
    private String alamat;
    @Basic(optional = false)
    @Column(name = "no_hp")
    private String noHp;
    @Basic(optional = false)
    @Column(name = "id_jenjang")
    private int idJenjang;

    public Guru() {
    }

    public Guru(Integer idGuru) {
        this.idGuru = idGuru;
    }

    public Guru(Integer idGuru, String nip, String namaGuru, String alamat, String noHp, int idJenjang) {
        this.idGuru = idGuru;
        this.nip = nip;
        this.namaGuru = namaGuru;
        this.alamat = alamat;
        this.noHp = noHp;
        this.idJenjang = idJenjang;
    }

    public Integer getIdGuru() {
        return idGuru;
    }

    public void setIdGuru(Integer idGuru) {
        this.idGuru = idGuru;
    }

    public String getNip() {
        return nip;
    }

    public void setNip(String nip) {
        this.nip = nip;
    }

    public String getNamaGuru() {
        return namaGuru;
    }

    public void setNamaGuru(String namaGuru) {
        this.namaGuru = namaGuru;
    }

    public String getAlamat() {
        return alamat;
    }

    public void setAlamat(String alamat) {
        this.alamat = alamat;
    }

    public String getNoHp() {
        return noHp;
    }

    public void setNoHp(String noHp) {
        this.noHp = noHp;
    }

    public int getIdJenjang() {
        return idJenjang;
    }

    public void setIdJenjang(int idJenjang) {
        this.idJenjang = idJenjang;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idGuru != null ? idGuru.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Guru)) {
            return false;
        }
        Guru other = (Guru) object;
        if ((this.idGuru == null && other.idGuru != null) || (this.idGuru != null && !this.idGuru.equals(other.idGuru))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "azhar.persistance.Guru[idGuru=" + idGuru + "]";
    }

}
